<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <title></title>
    <link href="/asset/css/admin.css" rel="stylesheet" />
    <script src="/asset/layui/layui.js?v=1.0.0"></script>
    <script src="/asset/js/common.js?v=1.0.0"></script>
    <style id='panda-theme-color'></style>
</head>
<body  class="theme-panda">
<div style="padding: 20px;background-color: white;">
    <form class="layui-form model-form">
        <input name="id" type="hidden" th:value="${info['id']}?:0">
        <input name="pid" id="pid" type="hidden" th:value="${info['pid']}?:0">

        <fieldset class="layui-elem-field layui-field-title">
            <legend style="font-size: 13px; color: #f56c6c;">注意：由于层级的关系，新增单位时，请在对应的部门下新增，新增部门直接新增在财政系统层级下</legend>
        </fieldset>
        <div class="layui-form-item">
            <label class="layui-form-label">部门名称：</label>
            <div class="layui-input-block">
                <input name="name" th:value="${info['name']}" lay-verify="required" autocomplete="off"
                       placeholder="请输入部门或单位名称" class="layui-input" type="text">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">类型：</label>
            <div class="layui-input-block">
                <select name="type" id="type" lay-verify="required" lay-search="" lay-filter="type">
                    <option value="">【请选择类型】</option>
                    <option value="1" th:selected="${info['type'] eq 1}">一级部门</option>
                    <option value="2" th:selected="${info['type'] eq 2}">二级单位</option></select>
                <div class="layui-form-select">
                    <div class="layui-select-title">
                        <input type="text" placeholder="【请选择类型】" value="公司" class="layui-input">
                        <i class="layui-edge"></i>
                    </div>
                    <dl class="layui-anim layui-anim-upbit">
                        <dd lay-value="" class="layui-select-tips">【请选择类型】</dd>
                        <dd lay-value="1" class=""th:class="${info['type'] eq 1} ? 'layui-this' : '' ">一级部门</dd>
                        <dd lay-value="2" class=""th:class="${info['type'] eq 2} ? 'layui-this' : '' ">二级单位</dd>
                    </dl>
                </div>
            </div>
        </div>
        <!--div class="layui-form-item">
            <label class="layui-form-label">有无子级：</label>
            <div class="layui-input-block" id="test">
                <input type="hidden"   value="2" name="hasChild" >
                <input type="checkbox" value="1" checked name="hasChild" id="hasChild" lay-filter="hasChild" lay-skin="switch"  lay-text="有子级|无子级" >
                <script th:inline="javascript" type="text/javascript">
                    layui.use(['form'], function(){
                        let form = layui.form,$ = layui.$;
                        form.on('switch(hasChild)', function(data) {
                            $(data.elem).val(this.checked ? 1 : 2);
                        });
                    });
                </script>
            </div>
        </div-->
        <div class="layui-form-item">
            <label class="layui-form-label">排序：</label>
            <div class="layui-input-block">
                <input name="sort" th:value="${info['sort']}" lay-verify="required|number" autocomplete="off"
                       placeholder="请输入排序" class="layui-input" type="text">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">负责人：</label>
            <div class="layui-input-block">
                <input name="leader" th:value="${info['leader']}" lay-verify="required" autocomplete="off"
                       placeholder="请输入负责人" class="layui-input" type="text">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">联系方式：</label>
            <div class="layui-input-block">
                <input name="mobile" th:value="${info['mobile']}" lay-verify="required" autocomplete="off"
                       placeholder="请输入联系方式" class="layui-input" type="text">
            </div>
        </div>

        <div class="layui-form-item layui-table-tool-temp model-form-footer" style="margin-top: 40px;">
            <button class="layui-btn layui-btn-primary" lay-filter="submitForm" lay-submit="">立即保存</button>
            <button class="layui-btn " type="button" pa-event="closeDialog">关&nbsp;&nbsp;&nbsp;&nbsp;闭</button>
        </div>
    </form>
</div>

<!-- JS部分 -->
<script type="text/javascript">
    layui.use(['func'], function () {

    });
</script>
</body>
</html>